package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 成都正谱
 */
public class ZhengPuUtil {


    //性别
    public static Integer getSex(Integer sex) {
        if (sex == 1) {
            return 1;
        }
        return 2;
    }

    //贷款金额
    public static Integer getloan(String loan) {
        if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la001.getValue(), loan)) {
            return 3;
        } else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la002.getValue(), loan)) {
            return 5;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la003.getValue(), loan)) {
            return 10;
        }else if (StrUtil.equals(BaseTypeInfoEnum.LoanAmount.la004.getValue(), loan)) {
            return 20;
        }
        return 50;

    }

    //贷款时间
    public static Integer getLoanTerm(String loanTime) {
        if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt001.getValue())) {
            return 3;
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt002.getValue())) {
            return 6;
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt003.getValue())) {
            return 12;
        }
        return 18;
    }

    //工作
    public static Integer getJob(String jbo) {
        if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz001.getValue())) {
            return 1;
        }
        return 2;
    }

    //房产
    public static Integer getHouse(String house) {
        if (StrUtil.equals(house, BaseTypeInfoEnum.House.hu001.getValue())) {
            return 2;
        }
        return 1;
    }

    //车产
    public static Integer getCar(String car) {
        if (StrUtil.equals(car, BaseTypeInfoEnum.Car.car001.getValue())) {
            return  2;
        }
        return 1;
    }

    //保险
    public static Integer getBaoxian(String baoxian) {
        if (StrUtil.equals(baoxian, BaseTypeInfoEnum.Baoxian.bx001.getValue())) {
            return 2;
        }
        return 1;
    }

    //社保
    public static Integer getshebao(String shebao) {
        if (StrUtil.equals(shebao, BaseTypeInfoEnum.Shebao.sb001.getValue())) {
            return 2;
        }
        return 1;
    }
    //公积金
    public static Integer getGjj(String gjj) {
        if (StrUtil.equals(gjj, BaseTypeInfoEnum.Gjj.gjj001.getValue())) {
            return 2;
        }
        return 1;
    }

    //逾期
    public static Integer getYuqi(String yuqi) {
        if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq001.getValue())) {
            return 2;
        }
        return 1;
    }

    //信用卡
    public static Integer getXinyongka(String xinyongka) {
        if (StrUtil.equals(xinyongka, BaseTypeInfoEnum.XinYongKa.xyk001.getValue())) {
            return 2;
        }
        return 1;
    }

    //工作
    public static Integer getJobMark(String jbo) {
        if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz002.getValue())) {
            return 1;
        }
        return 2;
    }

    //芝麻
    public static Integer getZhima(String zhima) {
        if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm002.getValue())) {
            return 1;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm003.getValue())) {
            return 2;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm004.getValue())) {
            return 3;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm005.getValue())) {
            return 4;
        }
        return 1;
    }

    //微粒
    public static Integer getWeili(String weili) {
        if (StringUtils.isNotEmpty(weili)){
            if (BaseTypeInfoEnum.WeiLi.wl001.getValue().equals(weili)){
                return 2;
            }else {
                return 1;
            }
        }
        return 2;
    }














}
